alter table jms_dm.dm_cusc_demand_delivery_waybill_detail_dt
    set tblproperties ('external.table.purge' = 'true');
drop table jms_dm.dm_cusc_demand_delivery_waybill_detail_dt;
CREATE EXTERNAL TABLE jms_dm.dm_cusc_demand_delivery_waybill_detail_dt
(
    order_id                   string comment '订单ID',
    waybill_id                 string comment '运单号',
    order_source_code_order    string comment '订单表-订单来源CODE',
    order_source_name_order    string comment '订单表-订单来源名称',
    input_time                 string comment '打标录入时间',
    arr_deliver_scantime       string comment '第一次派件时间(到件时间)',
    sign_time                  string comment '签收时间',
    deliver_usercode           string comment '派件业务员code',
    deliver_username           string comment '派件业务员name',
    deliver_scansite_code      string comment '派件网点code',
    deliver_scansite_name      string comment '派件网点name',
    deliver_fran_code          string comment '派件网点加盟商code',
    deliver_fran_name          string comment '派件网点加盟商name',
    deliver_agent_code         string comment '派件网点代理区code',
    deliver_agent_name         string comment '派件网点代理区name',
    first_network_network_code string comment '始发网点网点code',
    first_network_network_name string comment '始发网点网点name',
    first_network_fran_code    string comment '始发网点加盟商code',
    first_network_fran_name    string comment '始发网点加盟商name',
    first_network_agent_code   string comment '始发网点代理区code',
    first_network_agent_name   string comment '始发网点代理区name',
    is_reback                  string comment '是否退回',
    customer_code              string comment '客户编号CODE',
    customer_name              string comment '客户编号名称',
    delivery_way               string comment '派送方式',
    delivery_source            string comment '派送来源',
    actual_delivery_way        string comment '实际派送方式',
    sign_type                  string comment '签收类型',
    is_performance             int comment '是否履约',
    date_time                  date comment '分区日期'
)
    COMMENT '按需配送签收维度汇总(粒度网点)'
    PARTITIONED BY (
        dt string COMMENT '日期第一次签收时间')
    stored as parquet
    LOCATION
        '/dw/hive/jms_dm.db/external/dm_cusc_demand_delivery_waybill_detail_dt'
;
--hive
alter table jms_dm.dm_cusc_demand_delivery_waybill_detail_dt
    add columns (
        order_label string comment '标签集合',
        deliver_city_id string comment '派送城市id',
        deliver_city_desc string comment '派送城市name') cascade;
--doris
alter table jms_dm.dm_cusc_demand_delivery_waybill_detail_dt
    add column (
    order_label varchar (100) comment '标签集合',
    deliver_city_id varchar (100) comment '派送城市id',
    deliver_city_desc varchar (100) comment '派送城市name');